package com.yonyou.iuap.corp.demo.yonbip.notify;

import com.yonyou.iuap.corp.demo.yonbip.BaseTest;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

/**
 * @description: 发送工作通知
 * @author: nishch
 * @create: 2021-04-09
 **/
public class NotifyShare  extends BaseTest {

    /**
     *根据appcode获取服务列表 ykjId
     * 695549
     */
    @Test
    public void list_by_app_code() throws Exception {
        String url = "https://api.diwork.com/yonbip/uspace/app/list_by_app_code";
        Map<String, Object> params  = new HashMap<String, Object>();
        params.put("appCode","3a66edf2-c853-4d45-bb2a-3c2e3c412c98");
        baseApi.doGet(url,params);
    }

    /**
     * 发送工作通知
     * @throws Exception
     */
    @Test
    public void notifyShare() throws Exception {
        String url = "https://api.diwork.com/yonbip/uspace/notify/share";
        Map<String, Object> params  = new HashMap<String, Object>();
        String json = "{\"appId\":\"695549\",\"content\":\"this is a test notity\",\"sendScope\":\"list\",\"tenantId\":\"kuwm0ptf\",\"title\":\"test\",\"yhtUserIds\":[\"0f059088-9c92-4769-a3e7-8f1a341cc3df\",\"40b6b763-31af-46b3-b4b3-c62296914c6d\"]}";
        baseApi.doPostJson(url,json);
    }
}
